package com.zhiyin.game.Service;

import com.zhiyin.game.bean.Cell;
import org.springframework.stereotype.Component;

@Component
public class MapService {

    /**
     * 生成空地图数据
     * @param width  生成地图宽度
     * @param height  生成地图高度
     * @return
     */
    public Cell[][] initMapData(int width, int height) {
        Cell[][] map = new Cell[height][width];
        for(int i=0;i<height;i++){
            Cell[] column = new Cell[width];
            for(int j=0;j<width;j++){
                Cell cell = new Cell();
                column[j] = cell;
            }
            map[i] = column;
        }
        return map;
    }

}
